/**
 * Copyright © 2016-2024 The Thingsboard Authors
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
@import "../scss/constants";

:host {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 32px;
  overflow: auto;

  .color-input-container {
    display: flex;
    flex-direction: column;
    gap: 32px;
    @media #{$mat-sm} {
      flex-direction: row;
      gap: 12px;
    }
  }

  .control-input-container {
    display: flex;
    flex-direction: column;
    gap: 32px;
    @media #{$mat-sm} {
      width: 100%;
      justify-content: center;
    }
  }

  .saturation-component {
    width: 100%;
    height: 238px;
    min-height: 160px;
    border-radius: 8px;
    @media #{$mat-sm} {
      max-height: 160px;
    }
  }

  .control-component {
    max-height: 48px;
    display: flex;
    gap: 16px;

    .indicator-component {
      height: 48px;
      width: 48px;
      border-radius: 8px;
      background: transparent url('') repeat;
    }

    .hue-alpha-range {
      display: flex;
      justify-content: space-between;
      flex-direction: column;
      flex: 1;

      > * {
        height: 18px;
        overflow: hidden;
        border-radius: 9px;
        border: 1px solid rgba(0, 0, 0, 0.1);
      }
    }
  }

  .color-input-block {
    height: 56px;
    display: flex;
    align-items: center;
    gap: 20px;

    .presentation-select {
      font-size: 14px;
      width: 56px;
    }

    .color-input {
      flex: 1;
      width: min-content;
      &> * {
        color: initial;
      }
    }
  }

  .color-presets-block {
    .color-presets-component {
      display: flex;
      flex-direction: row;
      flex-wrap: wrap;
      justify-content: space-between;
      gap: 8px;
      @media #{$mat-xs} {
        flex-direction: column;
      }
    }
  }
}

:host ::ng-deep {
  .saturation-component {
    .pointer {
      border-width: 2px;
      width: 16px;
      height: 16px;
    }
  }

  indicator-component {
    svg {
      transform: scale(0.5);
      height: 100% !important;
      vertical-align: baseline !important;
    }
  }

  .hue-alpha-range {
    alpha-component, hue-component {
      .pointer {
        height: 18px;
        width: 18px;
        background: none;
        border: 2px solid #fff;
      }
      .gradient-color {
        border-radius: 9px;
      }
    }
  }

  .color-presets-component {
    .presets-row {
      gap: 8px;
      justify-content: space-between;
    }
    color-preset {
      height: 20px;
      width: 20px;
      border-radius: 4px;
      @media #{$mat-xs} {
        height: 40px;
        width: 48px;
      }
      @media #{$mat-sm} {
        height: 40px;
        width: 40px;
      }
    }
  }
}
